#pragma once

#include <stdio.h>

/* general failures
 * error codes < 100
 */
#define ERROR_OK						(0)
#define ERROR_NO_CONFIG_FILE			(-2)
#define ERROR_BUF_TOO_SMALL				(-3)
/* see "Error:" log entry for meaningful message to the user. The caller should
 * make no assumptions about what went wrong and try to handle the problem.
 */
#define ERROR_FAIL						(-4)
#define ERROR_WAIT						(-5)
/* ERROR_TIMEOUT is already taken by winerror.h. */
#define ERROR_TIMEOUT_REACHED			(-6)
#define ERROR_NOT_IMPLEMENTED			(-7)
#define ERROR_UNINIT                    (-8)

#define LOG_DEBUG_IO(...)
#define LOG_ERROR(exp, ...) //printf(exp "\r\n", ##__VA_ARGS__)
#define LOG_DEBUG(exp, ...) //printf(exp "\r\n", ##__VA_ARGS__)
#define LOG_INFO(exp, ...) //printf(exp "\r\n", ##__VA_ARGS__)
#define LOG_USER(expr ...)
#define LOG_WARNING(expr, ...) //printf(expr, "\r\n", ##__VA_ARGS__)

typedef struct
{
    void *ctx;
    void (*out)(void *ctx, const char *fmt, ...);
}ocd_logger_t;
